Skip to content
This repository has been archived by the owner on Nov 7, 2022. It is now read-only.

Fix has_preview exeption #423

Merged
merged 2 commits into from
Aug 24, 2021
Merged

Fix has_preview exeption #423

merged 2 commits into from
Aug 24, 2021

Conversation

ajkaanbal
Copy link
Contributor

I checked the signature of the removed function and I think coc#list#has_preview does the same.

neoclide/coc.nvim@00ed667#diff-600a800688b494cf9156b1d447016c253461ad3e3553ae6b9e52b31453e792deL22

function! coc#util#has_preview()
  for i in range(1, winnr('$'))
    if getwinvar(i, '&previewwindow')
      return i
    endif
  endfor
  return 0
endfunction

https://github.com/neoclide/coc.nvim/blob/e231666bcb532fac61ba50dd69e3b31477f43982/autoload/coc/list.vim#L102

" Check if previewwindow exists on current tab.
function! coc#list#has_preview()
  for i in range(1, winnr('$'))
    let preview = getwinvar(i, 'previewwindow', getwinvar(i, '&previewwindow', 0))
    if preview
      return i
    endif
  endfor
  return 0
endfunction

Solves #421

Copy link
Member

@ckipp01 ckipp01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just tried this out and it does seem to do the trick! Thanks @ajkaanbal. Just a small request about using the exported variable, but then LGTM!

src/index.ts Outdated Show resolved Hide resolved
Co-authored-by: Chris Kipp <ckipp@pm.me>
Copy link
Member

@ckipp01 ckipp01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks @ajkaanbal!

@ckipp01 ckipp01 linked an issue Aug 24, 2021 that may be closed by this pull request
@ckipp01 ckipp01 merged commit 7f8f935 into scalameta:main Aug 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

coc#util#has_preview was removed causing an exception
2 participants